package org.hxzon.demo.scala.matchdemo

object DayOfWeek extends Enumeration {
  val Sunday = Value("Sunday")
  val Monday = Value("Monday")
  val Tuesday = Value("Tuesday")
  val Wendesday = Value("Wendesday")
  val Thursday = Value("Thursday")
  val Friday = Value("Friday")
  val Saturday = Value("Saturday")
}
object EnumMatch {
  def activity(day: DayOfWeek.Value) {
    day match {
      case DayOfWeek.Sunday => println("Eat,sleep,repeat...")
      case DayOfWeek.Saturday => println("Hangout with friends...")
      case DayOfWeek.Monday => println("code and fun...")
      case DayOfWeek.Friday => println("read a good book...")
    }
  }
  def main(args: Array[String]): Unit = {
    List(DayOfWeek.Monday, DayOfWeek.Sunday, DayOfWeek.Saturday).foreach { activity }
    //code and fun...
    //Eat,sleep,repeat...
    //Hangout with friends...
  }
}